<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
 
    <script>
    
        // 1.属性的增强写法
        const name = 'why';
        const age = 18;
        const height = 1.88;
   
        const obj = {
            name,
            age,
            height,
        }
        
        console.log(obj);

        // 2.函数的增强写法
        const obj2 = {
            run () {
                console.log("run");
            },
            eat () {
                console.log("eat");
            }
        }
        // es5的写法
        // const obj3 = {
        //     run: function () {

        //     },
        //     eat: function () {

        //     }
        // }

    </script>
    
</body>
</html>